home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YAMscripts.lha / GEOhide.rexx < prev    next >
OS/2 REXX Batch file  |  1997-04-21  |  1KB  |  49 lines

  1. /* Hides the first part of a multipart message from YAM
  2. */ 
  3. options results
  4.    reply='yes'            /* if this yes, starts to reply to the processed message */
  5.      tmp='t:letter.tmp'
  6. HideWith='$'
  7.  
  8. address 'YAM'
  9. 'GetMailInfo file'
  10. if rc>0 then do
  11.     'Request "Select a message first!" "_Ok"'
  12.     exit
  13.     end
  14. else
  15.     file=result
  16.  
  17. if open(in,file,'r') & open(out,tmp,'w') then do
  18.     BeenThereDoneThat=0
  19.     do until r='' | eof(in)
  20.         r=readln(in)
  21.         call writeln(out,r)
  22.         if word(r,1)='Content-Type:' & ~BeenThereDoneThat then do
  23.             r=translate(r,' ','"')
  24.             boundary=word(r,words(r))
  25.             BeenThereDoneThat=1
  26.             end /* if word */
  27.         end /* do until */
  28.     NothingHiddenYet=1
  29.     do until eof(in) 
  30.         r=readln(in)
  31.         if pos(boundary,r)>0 & NothingHiddenYet then do
  32.             NothingHiddenYet=0
  33.             r=HideWith || r
  34.             end
  35.         if ~eof(in) then call writeln(out,r)
  36.         end /* do until */
  37.     call close(in)
  38.     call close(out)
  39.     address command 'c:copy' tmp file
  40.     address command 'c:delete' tmp
  41.     if upper(reply)='YES' then 'MailReply'
  42.     end /* if open */
  43. else do
  44.     'Request "Can not copy letter!" "_Ok"'
  45.     exit
  46.     end
  47.  
  48. exit
  49.